package com.lunar.service.impl;

import com.lunar.entity.Companyinfo;
import com.lunar.mapper.CompAnyInfoMapper;
import com.lunar.service.CompAnyInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CompAnyInfoServiceImpl implements CompAnyInfoService {

    @Autowired
    private CompAnyInfoMapper compAnyInfoMapper;

    @Override
    public List<Companyinfo> getAll() {
        return compAnyInfoMapper.selectAll();
    }

    @Override
    public int addCompAnyInfo(Companyinfo companyinfo) {
        return compAnyInfoMapper.insert(companyinfo);
    }

    @Override
    public int deleteComp(int cid) {
        return compAnyInfoMapper.deleteByPrimaryKey(cid);
    }

    @Override
    public List<Companyinfo> selectByName(String compName, String ownerTelName) {
        return compAnyInfoMapper.selectByName(compName,ownerTelName);
    }

}
